import javax.swing.*;
import java.awt.*;

public class Utils {

    /*
    * 根据屏幕的大小获取窗口的初始长宽
    * */
    public int[] getInitSize() {
        int height = 0;
        int width = 0;
        double tmp = 0.618;
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        double screenWidth = screenSize.getWidth();
        double screenHeight = screenSize.getHeight();
        width = (int)(screenWidth * tmp * tmp);
        height = (int)((double)width * tmp);

        int[] WH = {width,height};
        return WH;
    }


    /*
    * 获取窗口的实时大小
    * */
    public int[] getFrameCurrentSize(JFrame jFrame){
        int width = jFrame.getWidth();
        int height = jFrame.getHeight();

        int[] currentSize = {width,height};
        return currentSize;
    }
}
